package com.abuaziz.librarys.tset_adapter

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.abuaziz.librarys.R
import com.ug_project.views.content
import com.ug_project.views.findTextView
import kotlinx.android.synthetic.main.activity_auto_complete_adapter.*
import me.ezitku.base.adapter.createListAdapter

class AutoCompleteAdapter : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_auto_complete_adapter)

        auto_complete.setAdapter(
                createListAdapter(this, R.layout.item_spinner, arrayListOf("Java", "Janb")) {
                    this.GetView { position, view, parent, data ->
                        view.findTextView(R.id.item).content = data!![position]
                    }

                    this.filter { newText, data ->
                        true
                    }
                }
        )

    }

}
